$(function () {

		$('.submit').on('click', function () {
			var token = localStorage.phone;
			var teacher_id=localStorage.teacher;
			var time = $('.time').val();
			var obj = window.document.getElementById("subject");
			var address=$('#address').val();
			var subject=obj.options[obj.selectedIndex].text;
		$.ajax({
			url:"https://newapp.icandrive.cn/api/songkao.php",
			type:'post',
			data:{token:token,subject:subject,time:time,address:address,teacher_id:teacher_id},
			dataType:'json',
			success:function(data){
				if(data.status==200){
					layer.msg('约考成功');
					setInterval(function () {
						window.location.href='../index/index.html'
					},2000)
				}
				else{
					 layer.msg('系统繁忙',function(){
                                history.go(0)
                            },1000);
				}

						},
			error:function(){



			}
	})
		});
		})
